{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "522c2f1a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "ef803128",
   "metadata": {},
   "outputs": [],
   "source": [
    "xBegin = 0\n",
    "xend = 1\n",
    "D = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "fbec1df6",
   "metadata": {},
   "outputs": [],
   "source": [
    "bottom = 0\n",
    "top = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "d6d44a42",
   "metadata": {},
   "outputs": [],
   "source": [
    "def uBegin(x,x0 = 0.5):\n",
    "    return - 4 * (x - x0) ** 2 + 1 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "3142e16d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x2260ec88ac0>]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAApU0lEQVR4nO3dd3zV9b3H8dcnexASshjZCTNsCBsR3LhQkSGKSlWkjnrt9NZW7217a21ra1ulinuAgBRnwVEVQXbAsFcIWawkhASSkHm+94/k2lwI5ADnnN8Zn+fjwUNOzi85768Jb778zu/3/YoxBqWUUp7Pz+oASimlHEMLXSmlvIQWulJKeQktdKWU8hJa6Eop5SUCrHrh2NhYk5qaatXLK6WUR9q0aVOZMSaurecsK/TU1FSys7OtenmllPJIIlJwtuf0lItSSnkJLXSllPISWuhKKeUltNCVUspLaKErpZSXaLfQReRVESkR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Wx7HW53bBWP+OfB0y+/jgHIgyOrsFzHmccAQYPtZnnd4f7nzDN2tNqd2kXbHbIxZY4w53vJwHc27Q3kye77PAA8D/wBKXBnOSewZ8wxgqTGmEMAY4+njtmfMBogQEQE60Fzoja6N6TjGmJU0j+FsHN5f7lzoDtuc2oOc73juoflveE/W7phFJAG4GXgB72DP97kn0ElEVojIJhG502XpnMOeMT8H9KF5+8ptwCPGGJtr4lnC4f1l1wYXFnHY5tQexO7xiMgEmgt9rFMTOZ89Y34W+Jkxpql58ubx7BlzADAUuBwIBdaKyDpjzF5nh3MSe8Z8NZADXAZkAJ+LyCpjzAknZ7OKw/vLnQvdFzentms8IjIAeBmYaIw55qJszmLPmLOAhS1lHgtcKyKNxpj3XZLQ8ez92S4zxlQD1SKyEhgIeGqh2zPmWcDvTPMJ5lwROQD0Bja4JqLLOby/3PmUiy9uTt3umEUkGVgKzPTg2Vpr7Y7ZGJNmjEk1xqQCS4AHPLjMwb6f7Q+AS0QkQETCgBHALhfndCR7xlxI879IEJHOQC8gz6UpXcvh/eW2M3Tjg5tT2znmJ4AYYG7LjLXRePBKdXaO2avYM2ZjzC4R+QTYCtiAl40xbV7+5gns/D7/GnhdRLbRfDriZ8YYj11WV0TeAcYDsSJSDDwJBILz+ktv/VdKKS/hzqdclFJKnQctdKWU8hJa6Eop5SW00JVSyktooSullJfQQldKKS+hha6UUl7ifwH1ueMlj0GnQwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.linspace(0,1,100)\n",
    "u0 = uBegin(x)\n",
    "plt.plot(x,u0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "91e375c0",
   "metadata": {},
   "outputs": [],
   "source": [
    "dt = 0.001\n",
    "dx = 0.01\n",
    "signa = D * dt / (dx ** 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "d63f9d6b",
   "metadata": {},
   "outputs": [],
   "source": [
    "t = np.arange(xBegin,xend + dx,dx)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "1e19a381",
   "metadata": {},
   "outputs": [],
   "source": [
    "A = np.identity(t.size - 2)\n",
    "\n",
    "B = np.roll(A,1)\n",
    "B[0,0] = 0\n",
    "\n",
    "C = np.roll(A,-1)\n",
    "C[-1,-1] = 0\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "9405bee0",
   "metadata": {},
   "outputs": [],
   "source": [
    "AFinal = (1-2*signa)*A + signa * B + signa * C"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "e164ea4b",
   "metadata": {},
   "outputs": [],
   "source": [
    "bVector = np.zeros(t.size - 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "580c9f8c",
   "metadata": {},
   "outputs": [],
   "source": [
    "bVector[0] = signa * bottom\n",
    "bVector[-1] = signa * top"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "2b0c21bb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAEDCAYAAAAoWo9tAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAkHElEQVR4nO3dfZRcd3kf8O9zX2Zn9YIlS2vLlixk/IZfYuOwGIyJDcYhxjU4SaEQCBDiVoemUChJAzFtSMNpmxxOgNCEuiolpK0xcYtdjDE28iFY4BdAsi0h+QVLtrEElrVaSZZW0u7OvffpH/dl7ty5szvaua+73885OmhnRnd+d8x55tnn9/x+P1FVEBFRfRllD4CIiAbDQE5EVHMM5ERENcdATkRUcwzkREQ1x0BORFRzpQVyEfmKiOwTke19vPZKEXlERBwReUfiuQ+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Nfnfc87/dy3qj4hIvcA2AbAA/BlVU1tXauLPv97fwbAV0Xkp/DLDZ9Q1dpvbSsitwJ4I4CVIrIHwKcB2EB2cY1L9ImIaq5KpRUiIpoDBnIioppjICciqjkGciKimmMgJyKqOQZyIqKaYyAnIqq5/w99NAQXdhhFywAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "uCurrent = uBegin(t[1:-1])\n",
    "plt.plot(t[1:-1],uCurrent)\n",
    "for i in range(10):\n",
    "    uNext = AFinal @ uCurrent + bVector\n",
    "    plt.plot(t[1:-1],uNext)\n",
    "    uCurrent = uNext"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ef270bb6",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a1c94f6d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ecd5704f",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
